package org.suyisen.feng.core.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.suyisen.feng.core.dto.Cifuser;
import org.suyisen.feng.core.mapper.CifuserMapper;
import org.suyisen.feng.core.service.CifuserService;

/**
 * 
 */
@RestController
@RequestMapping("/icore")
public class CIfUserController {

	
	@Autowired
	CifuserMapper cifuserMapper;
	@Autowired
	CifuserService service;
	
	@GetMapping("/qycifuser")
	public List<Cifuser> getCifuserInfo() {
		List<Cifuser> list = service.queryAllCifusers();
		return list;
	}
	
	
	@GetMapping("/qyOnecifuser/{custid}")
	public Cifuser getOneCifuserInfo(@PathVariable String custid) {
		Cifuser one = service.queryOneCifuser(custid);
		return one;
	}
	
	
	@GetMapping("/qyTheOnecifuser")
	public Cifuser getTheOneCifuserInfo() {
		Cifuser one = service.queryTheOneCifuser();
		return one;
	}
	
	@PostMapping("/createCifuser")
	public String createCifUser(Cifuser user) {
		return service.createCifuser(user);
	}
	
	
	
}
